#include <stdio.h>

using namespace std;

int main() {
	int km = 0;
	int _day = 5;
	for (int year = 2000; year < 2021 ; year++) {
		for (int month = 1 ; month < 13; month++) {
			for (int day = 1 ; day < 32 ; day++) {
				if ( month == 4 || month == 6 || month == 9 || month == 11) {
					if (day > 30)break;
				}
				if (month == 2) {
					if ((year % 100 != 0 && year % 4 == 0) || year % 400 == 0) {
						if (day > 29)break;
					} else {
						if (day > 28)break;
					}
				}
				_day = (_day + 1) % 7;
				if (_day == 1 && day == 1) {
					km += 2;
				} else if (_day == 1 && day != 1) {
					km += 2;
				} else if (day == 1 && _day != 1) {
					km += 2;
				} else {
					km += 1;
				}
				if (year == 2020 && month == 10 && day == 1) {
					printf("%d", km);
					goto next;
				}
			}
		}
	}
next:
	return 0;
}
